package com.college.db.connection;

import java.io.FileInputStream;
import java.io.IOException;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;

public class DBConnecton {

	public Connection getDBConnection() throws SQLException, ClassNotFoundException, IOException {
				
		
		Properties pro = new Properties();
		FileInputStream in = new FileInputStream("D:/college.properties");
		pro.load(in);
		String driver = pro.getProperty("driver");
		String url = pro.getProperty("url");
		String uname = pro.getProperty("uname");
		String pwd = pro.getProperty("pwd");
		Class.forName(driver);
		return DriverManager.getConnection(url,uname,pwd);
	}
}
